package com.qiniuyun.backai.service.impl;

import cn.hutool.crypto.digest.DigestUtil;
import com.baomidou.mybatisplus.core.conditions.AbstractLambdaWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qiniuyun.backai.mapper.UserMapper;
import com.qiniuyun.backai.model.dto.UserDto;
import com.qiniuyun.backai.model.pojo.User;
import com.qiniuyun.backai.service.UserService;
import org.springframework.stereotype.Service;

/**
* @author Administrator
* @description 针对表【user(用户表)】的数据库操作Service实现
* @createDate 2025-09-28 14:52:33
*/
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User>
    implements UserService {


    @Override
    public Integer register(User user) {
        String username = user.getUsername();
        String password = user.getPassword();
        //将密码加密
        password= DigestUtil.md5Hex(password);
        UserDto userDto = new UserDto();
        userDto.setUsername(username);
        userDto.setPassword(password);
        Integer register = this.baseMapper.register(userDto);
        return register;
    }
}




